﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RegisterKey.aspx.cs" Inherits="ZLDC.Estate.PM.RegisterKey" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>收钥匙登记</title>
    <link href="../css/main.css" rel="stylesheet" type="text/css" />

    <script src="../js/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>

    <link href="../css/PLG.css" rel="stylesheet" type="text/css" />

    <script src="../js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>

    <script src="../js/LexunJS.js" type="text/javascript"></script>

    <script type="text/javascript">
        function AddKeyInfo() {
            var keyno = document.getElementById("txtkeyno").value;
            var tbUserName = document.getElementById("tbUserName").value;
            var keepKeyDate = document.getElementById("tbKeepKeyDate").value;
            if (keyno == "") {
                alert("请输入收钥匙编号！");
                return false;
            }
            if (tbUserName == "") {
                alert("请输入收钥匙人员！");
                return false;
             }
             if (keepKeyDate == "") {
                 alert("请输入收钥匙时间！");
                 return false;
             }
             var id = LexunJS.GetQueryString("id"); // 楼盘ID            
            $.ajax({
                type: 'POST',
                url: '../Handler/HandlerHousing.ashx',
                data: 'act=registerkey&hid=' + id + '&keyno=' + keyno + '&keepKey=' + tbUserName + '&keepkeydate=' + keepKeyDate,
                timeout: '10000',
                error: function() {
                    alert("修改失败！");
                },
                success: function(json) {
                    alert(json);
                    if(json !="收钥匙失败")
                    {
                        window.close();
                    }
                }
            });
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">

    <script src="../js/jquery.autocomplete.js" type="text/javascript"></script>

   
            <table  height="60" border="0" align="center" bgcolor="#CCCCCC" cellpadding="0"
                cellspacing="0">
                
                <tr>
                    <td bgcolor="#F7F7F7" >
                        <span>&nbsp;&nbsp; 钥匙编号：</span>
                    </td>
                    <td bgcolor="#FFFFFF">
                        <span >
                            <input id="txtkeyno" runat="server" size="15" style="width: 150px" />
                        </span>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#F7F7F7" >
                        <span>&nbsp;&nbsp; 收钥匙人：</span>
                    </td>
                    <td bgcolor="#FFFFFF">
                        <span >
                            <input id="tbUserName" name="tbUserName" size="15" maxlength="15" style="width: 150px" />
                        </span>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#F7F7F7">
                        <span>&nbsp;收钥匙时间： </span>
                    &nbsp;</td>
                    <td bgcolor="#FFFFFF">
                        <span >
                            <input id="tbKeepKeyDate" name="tbKeepKeyDate" size="15" maxlength="15" style="width: 150px"
                                onclick="WdatePicker()" />
                        </span>
                    </td>
                </tr>
            </table>
       
        <div id="tabbottom" style="text-align: right;">
            <input id="btnOk" class="button_bak" type="button" value="确定" onclick="AddKeyInfo()" />
            <input id="btnReturn" class="button_bak" type="button" value="返回" onclick="window.close();" />
        </div>
    </div>
    <input id="Operator" runat="server" type="hidden" />
    </form>
    <div align="center">
    </div>

    <script language="javascript" type="text/javascript">
        $(document).ready(function() {
            $("#tbUserName").autocomplete("../Ajax/GetUserAuto.aspx", { minChars: 2, extraParams: { uname: function() { return escape($('#tbUserName').val()); } }, scrollHeight: 350, width: 180, max: 100 });
            document.getElementById("tbUserName").focus();
        });
    </script>

</body>
</html>
